﻿
Partial Class uc_feature
    Inherits System.Web.UI.UserControl

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        If Not Page.IsPostBack Then
            FillSupportingData()
        End If

    End Sub

    Private Sub FillSupportingData()
        Dim _bl As New scrumrBL

        _bl.FillProjectList(ddlProjects)
        _bl.FillPrioritiesList(ddlPriority)

        _bl = Nothing
    End Sub

    Protected Sub bSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bSave.Click
        Dim _f As New feature
        lOutcome.Visible = True

        Try
            _f.AddFeature(ddlProjects.SelectedValue, tName.Text, tStory.Text, ddlPriority.SelectedValue)
            lOutcome.Text = String.Format("Feature {0} created!", _f.FeatureId)
            bSave.Visible = "False"
            bNewFeature.Visible = "True"
        Catch ex As Exception
            lOutcome.Text = ex.Message
        End Try

    End Sub

    Protected Sub bNewFeature_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles bNewFeature.Click
        Response.Redirect("FeatureMaintenance.aspx")
    End Sub

End Class
